<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login</title>

<script language="JavaScript">
function validate(form)
{

	var email = document.getElementById("emailWarning");
    var password = document.getElementById("passwordWarning");
    email.style.visibility="hidden";
    password.style.visibility="hidden";
    
    if (form.j_username.value=="") 
    {
        email.style.visibility="visible";
        form.email.focus();
    }
    else if (form.j_password.value == "") 
    {
        password.style.visibility="visible";
        form.password.focus();
    }

    else 
    {
        form.submit();
    }
}
</script>
</head>



<body>
<jsp:include page="/includes/nav.jsp" />
${failed }
<c:if test="${failed} == true ">
bla
</c:if>
<h1>You must login to continue.</h1>
<p>New to this site? You will need to <a
	href="<c:url value='/account/create_account.jsp' />">Register</a> before you can
login.</p>
<br>

<form action="j_security_check" method="post">
<table cellpadding="5" border="0">
	<tr>
		<td align="right">
		<p>Email Address:
		</td>
		<td><input type="text" name="j_username"></td>
		<td>
		<div id="emailWarning" style="visibility: hidden;">Please Enter
		a valid email address</div>
		<td>
	</tr>

	<tr>
		<td align="right">
		<p>Password:
		</td>
		<td><input type="password" name="j_password"></td>
		<td>
		<div id="passwordWarning" style="visibility: hidden;">If
		registering, both password fields must match.</div>
		<td>
	</tr>


	<tr>
		<td></td>
		<td><input type="button" value="Submit"
			onClick="validate(this.form)"></td>
	</tr>
</table>
</form>


</body>
</html>